﻿<?xml version="1.0" encoding="utf-8"?>
<clientTestSessionDescriptor>
    <clientSession id="c5bc0460-75d4-4de8-af18-d87cb4a70c62" testServerId="16eaa41e-e9da-4a2b-8a92-767bd2cca9fa" testSessionId="44accb76-49cc-4b14-baf0-34635fd6f5ea">
        <enableLog value="true" />
        <scheduledStartDateTime>2011-04-11T16:00:00Z</scheduledStartDateTime>

        <testScenario id="b80f5358-c44f-4a2b-a2bd-bad5f79b5a0e">
            
            <activity id="aac891bb-0f67-4b55-b108-37985e4dfb8d">
                <executionOrder>1</executionOrder>
                <preWaitingTimeInSeconds>1</preWaitingTimeInSeconds>
                <postWaitingTimeInSeconds>3</postWaitingTimeInSeconds>

                <activityItem type="SqlServerExecution">
                    <sqlServerExecution id="228f7430-4f5a-4436-a7e9-a31671128944">
                        <sqlQuery>
                          <![CDATA[UPDATE Customer SET Name = @Name WHERE Id = @Id ;]]>
                        </sqlQuery>
                    </sqlServerExecution>
                </activityItem>
                <activityContext id="5792a878-99a9-45c2-a7e2-746b30aa89c8">
                    <sqlServerExecutionContext id="d49b1001-b88b-4c25-b8d5-dc5539cf7d2f">
                        <connectionString>DataSource=C:\MyDB_A.sdf</connectionString>
                        <sqlQueryParameters count="2">
                            <parameter name="@Name" type="Nvarchar"><![CDATA[Bob]]></parameter>
                            <parameter name="@Id" type="Int"><![CDATA[120]]></parameter>
                        </sqlQueryParameters>
                    </sqlServerExecutionContext>
                </activityContext>
            </activity>

            <activity id="ffb1a3d4-f5a7-41b1-8006-c7477c835c36">
                <executionOrder>2</executionOrder>
                <preWaitingTimeInSeconds>1</preWaitingTimeInSeconds>
                <postWaitingTimeInSeconds>1</postWaitingTimeInSeconds>

                <activityItem type="SqlCeExecution">
                    <sqlCeExecution id="1dfb5818-6ec0-437e-9528-b85dd5b3e1dc">
                        <sqlQuery>
                          <![CDATA[INSERT INTO Customer (Name) VALUES (@Name) ;]]>
                        </sqlQuery>
                    </sqlCeExecution>
                </activityItem>
                <activityContext id="90c79807-473e-4efd-97d7-c9b66b4df6f3">
                    <sqlCeExecutionContext id="a2b7cae5-af23-4e7f-9fda-9693c42f8141">
                        <connectionString>DataSource=C:\MyDB_A.sdf</connectionString>
                        <sqlQueryParameters count="1">
                            <parameter name="@Name" type="Nvarchar"><![CDATA[Nicolas]]></parameter>
                        </sqlQueryParameters>
                    </sqlCeExecutionContext>                        
                </activityContext>
            </activity>

            <activity id="13f9fb39-c78b-4c39-82d0-649a3a8448f8">
                <executionOrder>3</executionOrder>
                <preWaitingTimeInSeconds>1</preWaitingTimeInSeconds>
                <postWaitingTimeInSeconds>1</postWaitingTimeInSeconds>

                <activityItem type="SqlCeBackup">
                    <sqlCeBackup id="56beaa4c-19af-40bc-975f-3d9150889f36" />
                </activityItem>
                <activityContext id="3a431715-df84-45b2-9df7-44a6cab4e336">
                    <sqlCeBackupContext id="e846d2ee-4aee-454a-bfc4-a0205627aa6d">
                        <sdfFileName>MyDB_A.sdf</sdfFileName>
                        <sdfFileDirectory>C:</sdfFileDirectory>
                    </sqlCeBackupContext>
                </activityContext>
            </activity>

            <activity id="e029fe03-8d5c-480c-af46-c499ff8299a5">
                <executionOrder>4</executionOrder>
                <preWaitingTimeInSeconds>6</preWaitingTimeInSeconds>
                <postWaitingTimeInSeconds>2</postWaitingTimeInSeconds>

                <activityItem type="SqlServerCheckData">
                    <sqlServerCheckData id="102d3cbc-992b-4737-8a1f-4363cccd6192">
                        <sqlQuery>
                          <![CDATA[SELECT Name FROM Customer WHERE Id = @Id ;]]>
                        </sqlQuery>
                        <expectedValue type="Nvarchar"><![CDATA[Bob]]></expectedValue>
                    </sqlServerCheckData>
                </activityItem>
                <activityContext id="33717460-7b3f-4100-81aa-cf46f2e3f7bb">
                    <sqlServerCheckDataContext id="4a4e6bc4-601a-49c9-a637-b8e42b55338b">
                        <connectionString>DataSource=C:\MyDB_A.sdf</connectionString>
                        <sqlQueryParameters count="1">
                            <parameter name="@Id" type="Int"><![CDATA[120]]></parameter>
                        </sqlQueryParameters>
                    </sqlServerCheckDataContext>
                </activityContext>
            </activity>

            <activity id="400c55ab-df3f-4fc8-9f59-5bf15202bb62">
                <executionOrder>5</executionOrder>
                <preWaitingTimeInSeconds>2</preWaitingTimeInSeconds>
                <postWaitingTimeInSeconds>1</postWaitingTimeInSeconds>

                <activityItem type="SqlCeCheckData">
                    <sqlCeCheckData id="bb72e845-6d95-4e5a-8f31-b9933565f56f">
                        <sqlQuery>
                          <![CDATA[SELECT Address FROM Customer Where ID = 345 ;]]>
                        </sqlQuery>
                        <expectedValue type="Nvarchar"><![CDATA[186 Fleet Street]]></expectedValue>
                    </sqlCeCheckData>
                </activityItem>
                <activityContext id="6da7a7c4-6765-42fa-850b-d28866fd37b1">
                    <sqlCeCheckDataContext id="131fc101-2c1b-4159-a17a-027d4bebf7bf">
                        <connectionString>DataSource=C:\MyDB_A.sdf</connectionString>
                        <sqlQueryParameters count="0" />
                    </sqlCeCheckDataContext>
                </activityContext>
            </activity>

            <activity id="fd0e830c-d5e0-4de8-a0f6-380f0555de84">
                <executionOrder>6</executionOrder>
                <preWaitingTimeInSeconds>1</preWaitingTimeInSeconds>
                <postWaitingTimeInSeconds>1</postWaitingTimeInSeconds>

                <activityItem type="MefExecution">
                    <mefExecution id="9285150f-4f16-45c1-b931-b5644cb9e304">
                        <mefComponentDirectory>C:\Zen4Sync\TestServer\MEF\MyMefComponent</mefComponentDirectory>
                        <metadata>
                            <Customers>
                                <Customer id="345">
                                    <Address>186 Fleet Street</Address>
                                </Customer>
                            </Customers>
                        </metadata>
                    </mefExecution>
                </activityItem>
                <activityContext id="589b829f-dab1-426e-8f9e-4d4555724836">
                    <mefExecutionContext id="f722506f-63ac-4539-9fe3-2f5e1ada04bf">
                        <metadata>
                            <Employee id="LKS-76" />
                        </metadata>
                    </mefExecutionContext>
                </activityContext>
            </activity>

            <!-- SyncSession WITH overriden data. -->
            <activity id="db381c44-ce99-49b0-9278-f5b19601df07">
                <executionOrder>7</executionOrder>
                <preWaitingTimeInSeconds>1</preWaitingTimeInSeconds>
                <postWaitingTimeInSeconds>1</postWaitingTimeInSeconds>

                <activityItem type="SyncSession">
                    <syncSession id="bff68c6d-23fa-4c75-86c8-d6151a73e4bb" exchangeType="Upload" snapshotTransferType="UNC">
                        <compressionLevel>1</compressionLevel>
                        <connectionRetryTimeout>2</connectionRetryTimeout>
                        <connectionTimeout>30</connectionTimeout>
                        <hostName>MySPECIFICHostName</hostName>
                        <loginTimetout>15</loginTimetout>
                        <postSyncCleanup>1</postSyncCleanup>
                        <publication>SpecialCustomers</publication>
                        <queryTimeout>10</queryTimeout>
                        <receiveTimeout>10</receiveTimeout>
                        <sendTimeout>15</sendTimeout>

                        <publisher id="d86b3a0b-098c-4821-96cd-91d7892b7fba" networkType="MultiProtocol" securityType="DBAuthentication">
                            <name>Specific Publisher</name>
                            <address>http://www.company.com/sqlmergesync/specificpublisher</address>
                            <database>SpecialCustomersRepository</database>
                            <login><![CDATA[SpecificEmployee]]></login>
                            <password><![CDATA[SpecificPassword]]></password>
                        </publisher> 

                        <distributor id="075061ad-8142-4af6-8a08-c8024acbe9d1" networkType="TcpIpSockets" securityType="NTAuthentication">
                            <name>Specific Distributor</name>
                            <address>http://www.company.com/sqlmergesync/specificdistributor</address>
                            <login><![CDATA[SpecificEmployee]]></login>
                            <password><![CDATA[SpecificPassword]]></password>
                            <profileName>SpecificProfileName</profileName>
                        </distributor>

                        <internet id="c9ecac19-9771-489b-9a36-c80e94f03acc">
                            <name>Special IIS Server</name>
                            <url>http://www.company.com/sqlmergesync/specialiis</url>
                            <login><![CDATA[SpecificEmployee]]></login>
                            <password><![CDATA[SpecificPassword]]></password>
                            <proxyServer>100.23.43.98</proxyServer>
                            <proxyLogin><![CDATA[oeirtdg]]></proxyLogin>
                            <proxyPassword><![CDATA[sdf.dsf0@]]></proxyPassword>
                        </internet>
                    </syncSession>
                </activityItem>
                <activityContext id="68af4480-309a-4c40-8b07-593c35501c33">
                    <syncSessionContext id="fb3d3177-dec2-4679-ae48-6fb8f6d16bc2">
                        <subscriber id="7bae1c71-92ff-44b2-aea4-85d579f2b47b" validateType="NoValidation">
                            <name>First Subscriber</name>
                            <hostName>MDT#1</hostName>
                            <connectionString>DataSource=C:\MyDB_A.sdf</connectionString>
                            <deleteSdfIfItExists value="true" />
                            <sdfFileName>MyDB_A.sdf</sdfFileName>
                            <sdfFileDirectory>C:</sdfFileDirectory>
                            <reinitializeSubscription value="true" />
                            <uploadBeforeReinitialize value="false" />
                        </subscriber>
                    </syncSessionContext>
                </activityContext>
            </activity>

            <activity id="115d83cd-26b6-4baa-b80b-21a1807ee77b">
                <executionOrder>8</executionOrder>
                <preWaitingTimeInSeconds>2</preWaitingTimeInSeconds>
                <postWaitingTimeInSeconds>2</postWaitingTimeInSeconds>

                <activityItem type="SyncSession">
                    <syncSession id="bff68c6d-23fa-4c75-86c8-d6151a73e4bb" exchangeType="BiDirectional" snapshotTransferType="FTP">
                        <compressionLevel>2</compressionLevel>
                        <connectionRetryTimeout>1</connectionRetryTimeout>
                        <connectionTimeout>60</connectionTimeout>
                        <hostName>MyGenericHostName</hostName>
                        <loginTimetout>30</loginTimetout>
                        <postSyncCleanup>0</postSyncCleanup>
                        <publication>AllCustomers</publication>
                        <queryTimeout>30</queryTimeout>
                        <receiveTimeout>30</receiveTimeout>
                        <sendTimeout>30</sendTimeout>

                        <publisher id="d86b3a0b-098c-4821-96cd-91d7892b7fba" networkType="TcpIpSockets" securityType="NTAuthentication">
                            <name>Main Publisher</name>
                            <address>http://www.company.com/sqlmergesync/publisher</address>
                            <database>CustomersRepository</database>
                            <login><![CDATA[GenericEmployee]]></login>
                            <password><![CDATA[GenericPassword]]></password>
                        </publisher>

                        <distributor id="075061ad-8142-4af6-8a08-c8024acbe9d1" networkType="DefaultNetwork" securityType="DBAuthentication">
                            <name>Main Distributor</name>
                            <address>http://www.company.com/sqlmergesync/distributor</address>
                            <login><![CDATA[GenericEmployee]]></login>
                            <password><![CDATA[GenericPassword]]></password>
                            <profileName>GenericProfileName</profileName>
                        </distributor>

                        <internet id="c9ecac19-9771-489b-9a36-c80e94f03acc">
                            <name>Main Company IIS Server</name>
                            <url>http://www.company.com/sqlmergesync/iis</url>
                            <login><![CDATA[GenericEmployee]]></login>
                            <password><![CDATA[GenericPassword]]></password>
                            <proxyServer>210.34.54.98</proxyServer>
                            <proxyLogin><![CDATA[sdpwo34s]]></proxyLogin>
                            <proxyPassword><![CDATA[;mjd@!fgr]]></proxyPassword>
                        </internet>
                    </syncSession>
                </activityItem>
                <activityContext id="610a4c1c-bbee-416f-9b3a-d9ee46fa578f">
                    <syncSessionContext id="fb3d3177-dec2-4679-ae48-6fb8f6d16bc2">
                        <subscriber id="7bae1c71-92ff-44b2-aea4-85d579f2b47b" validateType="NoValidation">
                            <name>First Subscriber</name>
                            <hostName>MDT#1</hostName>
                            <connectionString>DataSource=C:\MyDB_A.sdf</connectionString>
                            <deleteSdfIfItExists value="true" />
                            <sdfFileName>MyDB_A.sdf</sdfFileName>
                            <sdfFileDirectory>C:</sdfFileDirectory>
                            <reinitializeSubscription value="true" />
                            <uploadBeforeReinitialize value="false" />
                        </subscriber>
                    </syncSessionContext>
                </activityContext>
            </activity>

        </testScenario>
    </clientSession>
</clientTestSessionDescriptor>